home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
BASIC
/
2620A.ZIP
/
EXAMP1.ZIP
/
UMEX300.BAS
< prev
next >
Wrap
BASIC Source File
|
1990-04-09
|
718b
|
27 lines
'User's Manual Example, Page 300.
'
'Will not compile with DIM STATIC iarray%(1:n%).
'Changed $LINK "sum.obj" to $LINK "umex301.obj".
'Must compile "umex301.asm" to an .obj file.
'Added $LIB and $ERROR statements to reduce .EXE size.
'
'*************************************************************
$LIB ALL OFF
$ERROR ALL OFF
n% = 200 '200 elements in array
DIM iarray%(1:n%)
DECLARE FUNCTION suminteger&( INTEGER, INTEGER )
$LINK "umex301.obj"
FOR i% = 1 to n% 'initialize iarray%()
iarray%(i%) = i%
NEXT i%
thesum& = suminteger&( iarray%(1), n%) 'sum all 200 elements
PRINT "Array iarray%()'s sum = "; thesum&
END